﻿Imports ProcessingLite
Imports System.Windows.Media

Public Class MyFirstProcessingProject
    Implements IProcessingLiteDrawingProject

    Public Sub DrawStuff(drawer As IProcessingLiteDrawingService) Implements IProcessingLiteDrawingProject.DrawStuff

        For i = 0 To 700
            If i Mod 50 = 0 Then
                drawer.FillRectangle(i, i, 50, 50, RandomColor())
            End If
        Next i
    End Sub


    Sub AACircle(drawer As IProcessingLiteDrawingService)

    End Sub

    Private Function RandomColor() As Color
        Dim color As Color = New Color()
        Dim randomGenerator As Random = New Random(DateTime.Now.Second + DateTime.Now.Millisecond + DateTime.Now.Minute + DateTime.Now.Month)

        Dim randomBytes(4) As Byte

        randomGenerator.NextBytes(randomBytes)

        color.R = randomBytes(0)
        color.G = randomBytes(1)
        color.B = randomBytes(2)
        color.A = randomBytes(3)


        RandomColor = color

    End Function


End Class
